#ifndef MEM_POOL_H
#define MEM_POOL_H

#include <stddef.h>  // for size_t
#include <stdint.h>  // for standard integer types
#include "fake_inno_log_c.h"


#ifndef inno_log_info
#define inno_log_info(cmd_fmt, ...) \
    inno_log(INNO_LOG_LEVEL_INFO, __FILE__, __FUNCTION__, __LINE__, cmd_fmt, __VA_ARGS__)
#endif

#ifndef inno_log_error
#define inno_log_error(cmd_fmt, ...) \
    inno_log(INNO_LOG_LEVEL_ERROR, __FILE__, __FUNCTION__, __LINE__, cmd_fmt, __VA_ARGS__)
#endif

/* Define the size of memory blocks and memory pool capacity */
#define INNO_MEM_POOL_SIZE 1024
#define INNO_MEM_BLOCK_SIZE 32

typedef struct InnoMemPool InnoMemPool;
typedef struct InnoMemBlock InnoMemBlock;

/* Memory block structure */
struct InnoMemPool {
    uint8_t mem_pool[INNO_MEM_POOL_SIZE];
    InnoMemBlock* free_block_list;
};

/* Memory block structure */
struct InnoMemBlock {
    InnoMemBlock* next_block;
};

/* Initialize the memory pool */
void mem_pool_init(InnoMemPool* m_pool);

/* Allocate memory from the memory pool */
uint8_t* mem_pool_alloc(InnoMemPool* m_pool);

/* Free memory to the memory pool */
void mem_pool_free(InnoMemPool* m_pool, uint8_t* free_ptr);

// void inno_log_error(const char *cmd_fmt, ...);

// void inno_log_info(const char *cmd_fmt, ...);

#endif  // MEM_POOL_H
